<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>用户分组管理</title>
<link href="../css/style.css" rel="stylesheet" type="text/css" />
<link href="../css/style1.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="../js/jquery.js"></script>
<script language="javascript" src="../js/css.js"></script>
</head>

<body bgcolor="#FFFFFF">
<form name="form1" id="form1" method="post" action="">
<table border="0" cellpadding="0" cellspacing="0" class="rightable">
	<tr>
    	<td valign="top" class="rightdaohang" >您的位置： <a href="#">用户管理</a> > 用户分组管理</td></tr>
	<tr>
		<td class="rightmaintit">用户分组管理</td>
	</tr>
	<tr>
		<td align="center" class="rightmainborder"><img src="../images/rightmaintitborder.jpg" width="819" height="2" /></td>
	</tr>
	<tr>
		<td class="rightbody">
		<table border="0" cellpadding="0" cellspacing="0" class="toptable">
	    <tr>
    	<td><span class="tit1">分组：</span>
			<span class="tit2">
				<select name="select2">
        		<option selected="selected">所有分组</option>
        		<option>甲方</option>
        		<option>乙方</option>
        		<option>丙方</option>
        		<option>政府机关</option>
        		<option>个体用户</option>
      			</select> </span>
			
			<span class="tit2"><input type="button" name="Submit" value="查询" class="btnAddType" /></span>
		</td>
		<td class="btnpadding">		
        	<input type="button" name="Submit1" value="创建分组" class="btnCommon"  onclick="doAddGroup()"/>
		</td>    	
		</tr>
		</table>
		<table border="0" cellpadding="0" cellspacing="0"  class="table0" width="1051" height="96">
			<tr class="tr1">
			<td>分组</td><td>权限</td><td>操作</td>
			</tr>
			<tr>
			<td rowspan="1">A组</td>
			<td>项目数据维护<br />单一数据比对与分析<br /></td>
			<td><a href="#1" onclick="doEditGroup()">编辑</a>&nbsp;
				<a href="#1" onclick="doEditPermmision()">修改权限</a>&nbsp;
				<a href="#1" onclick="showMemberList()">组员明细</a>&nbsp;				
				<a href="#1" onclick="doDeleteType()">删除</a></td>			
			</tr>
		</table>
		<table border="0" cellpadding="0" cellspacing="0" class="pagetable">
	    	<tr>
		  		<td><div class="pageright"></div></td>
     	  	</tr>
        </table>
		</td>
	</tr>
 </table>
</form>

<div id="divBoxAddGroup" class="hideDlg"> 
	<h3><span id="closebtn1"><img src="../images/close.gif" onClick="closeGroup()" /></span>创建分组</h3>
	<form id="formCreateGroup">
        <table border="0" cellpadding="0" cellspacing="0" class="addtypetable">
		<tr>
           	<td class="td1" >分组名称：</td>
			<td class="td2" ><input type="text" name="groupName" class="input1" /></td>
           </tr>
        </table>
	 	<table border="0" cellpadding="0" cellspacing="0"  class="popbtntable" >
		<tr>
			<td>
				<input type="button" name="btnSaveGroup" class="btnCommon" value="创建" onclick="doSaveGroup()"/>&nbsp;
   				<input type="button" name="btnBackGroup" class="btnCommon"  value="取消" onclick="closeGroup()"/>
   			</td>
		</tr>
	</table>
	</form>
 </div>
 
<div id="divBoxEditGroup" class="hideDlg"> 
	<h3><span id="closebtn1"><img src="../images/close.gif" onClick="closeEditGroup()" /></span>编辑分组</h3>
    <table border="0" cellpadding="0" cellspacing="0" class="addtypetable">
		<tr>
          	<td class="td1" >分组名称：</td>
		<td class="td2" ><input type="text" name="textfield2" class="input1" /></td>
          </tr>
		<tr style="padding-bottom:10px;">
          	<td class="td1" >描述：</td>
			<td class="td2" ><textarea name="textarea" class="textarea1"></textarea></td>
          </tr>
       </table>
 	<table border="0" cellpadding="0" cellspacing="0"  class="popbtntable" >
		<tr>
			<td>
				<input type="button" name="btnSaveEditGroup" class="btnCommon" value="保存" onclick="doSaveEditGroup()"/>&nbsp;
  				<input type="button" name="btnBackEditGroup" class="btnCommon"  value="取消" onclick="closeEditGroup()"/>
  			</td>
		</tr>
	</table>
</div>

<script language="javascript">
function showMemberList(){
  location.href="groupMemberList.html";
}
function doDeleteGroup(){
  //通过ajax保存信息
  alert("删除分组，然后自动从“分组”的下拉列表中删除选项！");
}

function doEditPermmision(){
  location.href("editGroupPermission.html");
}

var returnId;
/*↓↓↓↓↓↓↓↓↓↓创建分组↓↓↓↓↓↓↓↓↓↓*/
function doSaveGroup(){
	alert("save group");
	var form = document.getElementById("formCreateGroup");
	form.action = "groupManageAction.do?method=createGroup";
	form.method = "post";
	form.submit();
  //通过ajax保存信息
    closeGroup();
    alert("添加一个分组，然后自动加入到“分组”的下拉列表中！");
}

function doAddGroup(ids,names,maxCount)
{
	var dialogHeight = 200;
    var dialogWidth = 400;

 	document.oncontextmenu=function(){event.returnValue=false;};
   
    //显示遮盖的层
    var objDeck = document.getElementById('deck');
    if(!objDeck)
    {
        objDeck = document.createElement("div");
        objDeck.id="deck";
        document.body.appendChild(objDeck);
    }
    else{
		objDeck.style.display = 'block';
	}
    objDeck.className="showDeck";
    objDeck.style.height = document.body.scrollHeight;
    
    //显示对话框
    var dde=document.documentElement;
    var obox=document.getElementById('divBoxAddGroup');
     
 	//下面用于计算对话框的位置
 	testLeft=1.0;
    testTop=1.0;
    var objbody= document.compatMode=="CSS1Compat"?document.documentElement:document.body;
    var dw = objbody.clientWidth, dl = objbody.scrollLeft, dt = objbody.scrollTop, dh = objbody.clientHeight;
    var cw = dialogWidth, ch = dialogHeight;
 	testLeft = (dw-cw)/2+dl;
 	testTop = (dh-ch)/2+dt;
 	
    obox.style.left=testLeft;
    obox.style.top=testTop;		
    
 	obox.style.height=dialogHeight;
    obox.style.width=dialogWidth;
 	obox.style.zIndex=9999;
    var IfrRef = document.getElementById("divBoxAddGroup");
    IfrRef.className='showDlg';	
	IfrRef.style.width = obox.offsetWidth; 
	IfrRef.style.height = obox.offsetHeight; 
	IfrRef.style.top = obox.style.top; 
	IfrRef.style.left = obox.style.left; 
	IfrRef.style.zIndex = obox.style.zIndex - 1;
	IfrRef.style.display = 'block';
	
    returnId = setTimeout('doAddGroup()',30);      
}
   
function closeGroup(){
    clearTimeout(returnId);
    returnId=null;
	var objbody= document.compatMode=="CSS1Compat"?document.documentElement:document.body;
	
    document.getElementById("divBoxAddGroup").style.display = "none";
    var bgObj = document.getElementById('deck');
	bgObj.style.display = "none";

    document.oncontextmenu=function(){event.returnValue=true;};
}
/*↑↑↑↑↑↑↑↑↑↑创建分组↑↑↑↑↑↑↑↑↑↑*/	

/*↓↓↓↓↓↓↓↓↓↓编辑分组↓↓↓↓↓↓↓↓↓↓*/
function doSaveEditGroup(){
  //通过ajax保存信息
  closeEditGroup();
  alert("修改分组，修改“分组”的下拉列表选项！");
}

function doEditGroup(ids,names,maxCount)
{
	var dialogHeight = 200;
    var dialogWidth = 400;

 	document.oncontextmenu=function(){event.returnValue=false;};
   
    //显示遮盖的层
    var objDeck = document.getElementById('deck');
    if(!objDeck)
    {
        objDeck = document.createElement("div");
        objDeck.id="deck";
        document.body.appendChild(objDeck);
    }
    else{
		objDeck.style.display = 'block';
	}
    objDeck.className="showDeck";
    objDeck.style.height = document.body.scrollHeight;
    
    //显示对话框
    var dde=document.documentElement;
    var obox=document.getElementById('divBoxEditGroup');
     
 	//下面用于计算对话框的位置
 	testLeft=1.0;
    testTop=1.0;
    var objbody= document.compatMode=="CSS1Compat"?document.documentElement:document.body;
    var dw = objbody.clientWidth, dl = objbody.scrollLeft, dt = objbody.scrollTop, dh = objbody.clientHeight;
    var cw = dialogWidth, ch = dialogHeight;
 	testLeft = (dw-cw)/2+dl;
 	testTop = (dh-ch)/2+dt;
 	
    obox.style.left=testLeft;
    obox.style.top=testTop;		
    
 	obox.style.height=dialogHeight;
    obox.style.width=dialogWidth;
 	obox.style.zIndex=9999;
    var IfrRef = document.getElementById('divBoxEditGroup');
    IfrRef.className='showDlg';	
	IfrRef.style.width = obox.offsetWidth; 
	IfrRef.style.height = obox.offsetHeight; 
	IfrRef.style.top = obox.style.top; 
	IfrRef.style.left = obox.style.left; 
	IfrRef.style.zIndex = obox.style.zIndex - 1;
	IfrRef.style.display = 'block';
	
    returnId = setTimeout('doEditGroup()',30);      
}
   
function closeEditGroup(){
    clearTimeout(returnId);
	var objbody= document.compatMode=="CSS1Compat"?document.documentElement:document.body;
	
    document.getElementById('divBoxEditGroup').style.display = "none";
    var bgObj = document.getElementById('deck');
	bgObj.style.display = 'none';

    document.oncontextmenu=function(){event.returnValue=true;};
}
/*↑↑↑↑↑↑↑↑↑↑编辑分组↑↑↑↑↑↑↑↑↑↑*/	

</script>

</body>
</html>
